package com.chang.dp.utils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chang.dp.entity.BaseEntity;

public class QueryUtil {
    /**
     * 分页查询根据创建时间范围搜索处理
     * @param queryWrapper
     * @param baseEntity
     */
    public static void dealPageListQueryWrapperTime (QueryWrapper<BaseEntity> queryWrapper, BaseEntity baseEntity) {
        if (baseEntity.getCreateTimeStart() != null) {
            queryWrapper.gt("create_time", baseEntity.getCreateTimeStart());
        }
        if (baseEntity.getCreateTimeStart() != null) {
            queryWrapper.lt("create_time", baseEntity.getCreateTimeEnd());
        }
    }
}
